//ref
import React from "react";
import { Fn, C, ForWard } from "./List";

const App = function () {
  const ref = React.useRef("娃哈哈哈哈哈");
  console.log(ref);
  //从上向下的所以要生命周期
  React.useEffect(() => {
    //ref直接给类子组件使用,获取的是类组件的实例对象,如果给函数组件用则会报错
    ref.current.focus();
    console.log(ref.current)
  }, []);
  return (
    <div>
      123
      <Fn></Fn>
      <C></C>
      <ForWard></ForWard>
      <input type="text" ref={ref} />
    </div>
  );
};
export default App;
